import string
from google.appengine.ext import db


keys = 'abcdefghijklmnopqrstuvwxyz 1234567890'
values = str(db)
#enter this


alphabet = "abcdefghijklmnopqrstuvwxyz 1234567890"


def encode(word):
    encoding = {}
    for i, key in enumerate(keys):
        encoding[key] = values[i]
    new_words = ""
    for letter in word:
        if letter in alphabet:
            new_words = new_words + encoding[letter]
        else:
            new_words = new_words + letter
    return new_words

def decode(word):
    encoding = {}
    for i, key in enumerate(values):
        encoding[key] = keys[i]
    new_words = ""
    for letter in word:
        if letter in alphabet:
            new_words = new_words + encoding[letter]
        else:
            new_words = new_words + letter
    return new_words
